<?php
defined("_VALID_ACCESS") || die('Direct access forbidden');
class Eyeworx_PatientRecords_EyesInstall extends ModuleInstall
{

    public function install()
    {
        try {
            $eyes_recordset = new Eyeworx_PatientRecords_Eyes_RBO_RBOEyes();
            $eyes_recordset->install();
            $eyes_recordset->add_default_access();
            Utils_RecordBrowserCommon::new_addon('eyeworx_patient', 'Eyeworx/PatientRecords/Eyes', 'patient_rx_addon', 'Rx Information');
        } catch (Exception $e) {
            return false;
        }
        return true;
    }

    public function uninstall()
    {
        try {
            $eyes_recordset = new Eyeworx_PatientRecords_Eyes_RBO_RBOEyes();
            $eyes_recordset->uninstall();
            Utils_RecordBrowserCommon::delete_addon('eyeworx_patient', 'Eyeworx/PatientRecords/Eyes', 'patient_rx_addon', 'Rx Information');
        } catch (Exception $e) {
            return false;
        }
        return true;
    }

    public function requires($v)
    {
        return array(
            array('name' => 'Base/Lang', 'version' => 0),
            array('name' => 'Utils/RecordBrowser', 'version' => 0),

        );
    }

    public function info()
    {
        return array(
            'Author' => 'Maureen D. Velicaria',
            'Description' => 'Eye Information of Patient'
        );
    }

    public function version()
    {
        return array('1.0');
    }

    public function simple_setup()
    {
        return array('package' => __('Eyeworx'), 'option' => __('Eyes'));
    }

}

?>